/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sopra09.lv6659438.controller.awfUnabhaengigeKomponenten;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;

/**
 * Ersetzt eine ForwardAction mit dem einzigen Zweck die Session-Attribute für
 * die Orientierungsleiste zu setzen.
 * @author work
 */
public class AGBAufrufenA extends org.apache.struts.action.Action {
    
    /* forward name="success" path="" */
    private final static String AGB_AUFRUFEN= "agbAufrufen";
    
    /**
     * Setzt die Session-Attribute für die Orientierungsleiste.
     * @param mapping The ActionMapping used to select this instance.
     * @param form The optional ActionForm bean for this request.
     * @param request The HTTP Request we are processing.
     * @param response The HTTP Response we are processing.
     * @throws java.lang.Exception
     * @return ActionForward
     */
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {

        request.getSession().setAttribute("AWF", "AGB");
        request.getSession().setAttribute("AA", "unsere Allgemeinen Geschäftsbedingungen");

        return mapping.findForward(AGB_AUFRUFEN);
    }
}
